import request from "@/router/axios";

// 获取代理商列表
export const getAgentList = (params) => {
  return request({
    url: "/api/admin/user/getAgentManage",
    method: "get",
    params: { ...params },
  });
};

// 添加代理商
export const addAgent = (data) => {
  return request({
    url: "/api/admin/user/create",
    method: "post",
    data: data,
  });
};


// 删除代理商
export const deleteAgent = (id) => {
  return request({
    url: `/api/admin/user/delete/?id=${id}`,
    method: "delete",
  });
};

// 设置代理商状态
export const setAgentStatus = (params) => {
  return request({
    url: `/api/admin/user/changeStatus/${params.id}`,
    method: "get",
    params: {
      status: params.status,
    },
  });
};

// 获取代理商详情
export const getAgentDetail = (data) => {
  return request({
    url: `/api/admin/user/getAgentLog`,
    method: "get",
    params: { ...data },
  });
};

// 重置代理商密码
export const resetAgentPassword = (data) => {
  return request({
    url: `/api/admin/user/update`,
    method: "post",
    data: data,
  });
};

